package com.itheima.service.impl;

import com.itheima.service.FileService;
import com.itheima.dao.FileMapper;
import com.itheima.pojo.File;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class FileServiceImpl implements FileService {

    @Autowired
    private FileMapper fileMapper;

    /**
     * 根据uid查询图片
     * @param fileUid
     * @return
     */
    @Override
    public File getPictureById(String fileUid) {
        return fileMapper.getFileByUid(fileUid);
    }


    @Override
    public String getPicUrlByUid(String fileUid) {
        return fileMapper.getPicUrlByUid(fileUid);
    }

    @Override
    public void add(File file) {
        fileMapper.insertSelective(file);
    }

}
